package hsh.machine.components;

public class Home {
	private static Home home;
	private PrimaryMemory primaryMemory;
	private SecondaryMemory secondaryMemory;
	private Processor processor;
	
	private Home(){
		Bus bus = new Bus(primaryMemory,secondaryMemory,processor);
		secondaryMemory = new SecondaryMemory(50,bus);
		primaryMemory = new PrimaryMemory(10,bus);
		processor = new Processor(bus);
	}
	
	
	public static Home getHome(){
		if(home == null){
			home = new Home();
		}
		
		return home;
	}


	public PrimaryMemory getPrimaryMemory() {
		return primaryMemory;
	}


	public SecondaryMemory getSecondaryMemory() {
		return secondaryMemory;
	}


	public Processor getProcessor() {
		return processor;
	}
	
}
